//----------------------------------------------------------------------------------------------
//	Filename:	PointCloud.h
//	Author:		Sandro Spina
//	Date:		21/08/2012
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
#pragma once

#include "Shape/VertexFormats.h"

namespace Illumina 
{
	namespace Core
	{		
		class CloudPoint
		{
			public:
				VertexP m_vertex;
				int		m_segmentId;	//Surface or edge segment id				
				int		m_groupId;		//material group associated with object (set of segments)
				char	m_typeId;		//-1==duplicate (and should be removed), 0==undefined, 1==line(2D), 2==corner(2D), 3==edge(3D), 4==surface(3D), 6==corner(3D), 7==pruned				
				char	m_visible;		//1 if visible, 0 if not.
				char    m_seed;			//1 if seed, 0 if not.

				short	m_segmentId2;	//Surface or edge segment id associated with the internal graph of a surface segment
				char	m_typeId2;		//Type of point associated with internal graph of the surface segment ... could be surface or edge.

				Vector3 m_normal;		//Stores the normal (set when computing point type) of the point

				CloudPoint(VertexP p_vertex, int p_groupId, int p_typeId, int p_segmentId) 
				{
					m_vertex.Position.X = p_vertex.Position.X;
					m_vertex.Position.Y = p_vertex.Position.Y;
					m_vertex.Position.Z = p_vertex.Position.Z;
					
					m_groupId = p_groupId;
					m_typeId = p_typeId;
					m_segmentId = p_segmentId;
					m_visible = 1;
					m_seed = 0;
					m_segmentId2 = -1;
					m_typeId2 = 0;
					m_normal.X = 0;
					m_normal.Y = 0;
					m_normal.Z = 0;
				}

				CloudPoint(VertexP p_vertex, int p_groupId, int p_typeId, int p_segmentId, int p_segmentId2) 
				{
					m_vertex.Position.X = p_vertex.Position.X;
					m_vertex.Position.Y = p_vertex.Position.Y;
					m_vertex.Position.Z = p_vertex.Position.Z;
					m_groupId = p_groupId;
					m_typeId = p_typeId;
					m_segmentId = p_segmentId;
					m_visible = 1;
					m_seed = 0;
					m_segmentId2 = p_segmentId2;
					m_typeId2 = 0;					
				}

				CloudPoint(float p_x, float p_y, float p_z) 
				{
					m_vertex.Position.X = p_x;
					m_vertex.Position.Y = p_y;
					m_vertex.Position.Z = p_z;
					m_groupId = 1;
					m_typeId = 0;
					m_segmentId = -1;
					m_visible = 1;
					m_seed = 0;
					m_segmentId2 = -1;
					m_typeId2 = 0;
				}

				CloudPoint(Vector3 &_p) 
				{
					m_vertex.Position.X = _p.X;
					m_vertex.Position.Y = _p.Y;
					m_vertex.Position.Z = _p.Z;
					m_groupId = 1;
					m_typeId = 0;
					m_segmentId = -1;
					m_visible = 1;
					m_seed = 0;
					m_segmentId2 = -1;
					m_typeId2 = 0;
				}				

				~CloudPoint() {}					
		};			
	}
}